/*
 * @Description: 预览弹窗
 * @Author: Zzt
 * @Date: 2023-02-21 10:49:15
 * @LastEditTime: 2023-02-28 19:36:16
 */

import Editor from '@/components/BundledEditor';
import JPModal from '@/components/JPComponents/JPModal';
import { ICommonDialog } from '@/interfaces/global';
import { Button, Col, Row } from 'antd';
import classNames from 'classnames/bind';
import styles from '../../styles/channel.module.scss';

const cx = classNames.bind(styles);
interface IPreviewAnnounce extends ICommonDialog {
  data: any;
}

const PreviewAnnounce = (props: IPreviewAnnounce) => {
  const { visible, onClose, data } = props;
  const { notice } = data;
  return (
    <>
      <JPModal
        width={600}
        // draggable={true}
        title="公告详情"
        visible={visible}
        onCancel={onClose}
        footer={
          <Button key={'ok'} onClick={() => onClose()}>
            确认
          </Button>
        }
      >
        <Row gutter={[16, 16]}>
          <Col span={10}>
            <b>标题：</b>
            {notice?.title}
          </Col>
          <Col span={4}>
            <b>作者：</b>
            {notice?.author}
          </Col>
          <Col span={10}>
            <b>发布时间：</b>
            {notice?.publicTime}
          </Col>

          <Col span={24}>
            <div className={cx('content-view')}>
              <span dangerouslySetInnerHTML={{ __html: notice?.content }}></span>
            </div>
          </Col>
        </Row>
      </JPModal>
    </>
  );
};
export default PreviewAnnounce;
